package com.bailian.spring.ioc.basic_dl.dl_withanno;

import com.bailian.spring.ioc.basic_dl.dl_withanno.anno.Color;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Map;

/**
 * @author gaoxu
 * date: Created on 2021/10/28 下午5:38
 */
public class WithAnnoApplication {
    public static void main(String[] args) {
        ApplicationContext ctx
                = new ClassPathXmlApplicationContext("basic_dl/quickstart-withanno.xml");
        Map<String, Object> beans = ctx.getBeansWithAnnotation(Color.class);
        beans.forEach((name, bean) -> {
            System.out.println(name + " : " + bean);
        });
    }
}
